def readline(file):
    with open(file, 'r') as f:
        while 1:
            line = f.readline()
            if line:
                line = line.replace('\n', '')
                lst = map(lambda i: int(i), line)
                yield lst
            return

def read_file(fpath):
    BLOCK_SIZE = 1024
    with open(fpath, 'rb') as f:
        while True:
            block = f.read(BLOCK_SIZE)
            if block:
                yield block
            else:
                return

def prase(array):
    length = len(array)

    for i in range(length):
        width = len(array[i])
        for j in range(width):
            print array[i][j],
        print

if __name__ == '__main__':
    array = []
    for line in read_file('D:/lst_img.txt'):
        array.append(line)

    prase(array)